<#assign pageName="编辑用户信息">
<@override name="head-styles">
</@override>
<@override name="page-content">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>${pageName}</legend>
    </fieldset>
    <form class="layui-form padding-10" lay-filter="formUserEdit">
         <@ctrl.Hidden path="users.userId" />
         <@ctrl.Hidden path="users.indate" />
         <@ctrl.Hidden path="users.pwd"/>
         <@ctrl.Hidden path="users.logintimes" />
         <@ctrl.Textbox path="users.uname" labelText="用户名称" required="required"/>
         <@ctrl.SingleSelect path="users.enable" options={'T':'启用','F':'禁用'} labelText="启用状态" required="required"/>
         <@ctrl.CheckboxList path="users.guid" options=guidList![] labelText="管理平台" textField="sysModuleName" valueField="guid"/>
         <@ctrl.FormAction backURL="../management"/>
     </form>
</@override>
<@override name="page-scripts">
    <script>
        $(function(){
            layui.use(['form','layer', 'jquery'], function(){
                var form = layui.form;
                var layer=layui.layer;
                $=layui.jquery;
                //监听提交
                form.on('submit(submit)', function(data){
                    var checkedGuid =[]; 
                    $('input[name="guid"]:checked').each(function(index, item){ 
                        checkedGuid.push($(this).val()); 
                    });
                    data.field.guid = checkedGuid;
                    submitData(data.field, '${contextPath}/admin/users/edit', function(){location.href="${contextPath}/admin/users/management";});
                    return false;
                });
            })
       })
    </script>
</@override>
<@extends name="/layout/basepage.html"/> 
